package com.atguigu.guli.edu.controller.api;

import com.atguigu.common_utils.utils.PageUtils;
import com.atguigu.guli.edu.entity.Teacher;
import com.atguigu.guli.edu.service.EduTeacherService;
import com.atguigu.guli.service.base.result.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;
import java.util.Map;


/**
 * 讲师
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2021-01-19 10:59:18
 */
@Api(tags = "讲师模块")

@RestController
@RequestMapping("/api/edu/eduteacher")
public class ApiEduTeacherController {
    @Autowired
    private EduTeacherService eduTeacherService;


    //查询所有讲师
    @ApiOperation("查询所有讲师")
    @GetMapping("/list")
    public R selectList(){
        List<Teacher> list = eduTeacherService.list(null);
        return R.ok().data("data",list);
    }

    @ApiOperation("根据id查询讲师信息")
    @GetMapping("/get/{teacherId}")
    public R getById(@PathVariable String teacherId){
        Teacher teacher = eduTeacherService.getById(teacherId);
        return R.ok().data("data",teacher);
    }




}
